package boundary;

import java.awt.BorderLayout;

import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;

public class Textbox extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JTextArea text = null;

	/**
	 * This is the default constructor
	 */
	public Textbox() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 200);
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getText(), BorderLayout.CENTER);
		}
		return jContentPane;
	}

	/**
	 * This method initializes text	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getText() {
		if (text == null) {
			text = new JTextArea();
			text.addKeyListener(new java.awt.event.KeyAdapter() {
				public void keyTyped(java.awt.event.KeyEvent e) {
					JPopupMenu menu = new JPopupMenu("Menu");
					menu.add(new JMenuItem("Item 1"));
					menu.add(new JMenuItem("Item 2"));
					menu.add(new JMenuItem("Item 3"));
					menu.setVisible(true);
				}
			});
		}
		return text;
	}

}
